]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
weather: Pick up original settings values
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 1 Aug 2019 13:18:43 +0000 (13:18 +0000)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 7 Aug 2019 18:53:41 +0000 (18:53 +0000)
We mirror Weather's location settings to not depend on the app running,
but then don't read the original values, oops.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1158

js/misc/weather.js

index f097c76f617f4897fc3b60c1c0d954702fd9a475..51dd8acde895f02e0454231515d3cb2fd148fe27 100644 (file)
@@ -94,8 +94,10 @@ var WeatherClient = class {
         });
         this._settings.connect('changed::automatic-location',
             this._onAutomaticLocationChanged.bind(this));
+        this._onAutomaticLocationChanged();
         this._settings.connect('changed::locations',
             this._onLocationsChanged.bind(this));
+        this._onLocationsChanged();
 
         this._appSystem = Shell.AppSystem.get_default();
         this._appSystem.connect('installed-changed',
@@ -259,8 +261,8 @@ var WeatherClient = class {
         this._setLocation(location);
     }
 
-    _onAutomaticLocationChanged(settings, key) {
-        let useAutoLocation = settings.get_boolean(key);
+    _onAutomaticLocationChanged() {
+        let useAutoLocation = this._settings.get_boolean('automatic-location');
         if (this._autoLocationRequested == useAutoLocation)
             return;
 
@@ -278,8 +280,9 @@ var WeatherClient = class {
             this._setLocation(this._mostRecentLocation);
     }
 
-    _onLocationsChanged(settings, key) {
-        let serialized = settings.get_value(key).deep_unpack().shift();
+    _onLocationsChanged() {
+        let locations = this._settings.get_value('locations').deep_unpack();
+        let serialized = locations.shift();
         let mostRecentLocation = null;
 
         if (serialized)